package com.by.course.config.web.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author zhd
 * @date 2023/09/12 19:10
 **/
@Component
public class CompoundStrategy implements UriInterceptStrategy {

    @Autowired
    private List<UriInterceptStrategy> whiteInterceptList;

    @Override
    public boolean verify(String uri) {
        for (UriInterceptStrategy uriInterceptStrategy : whiteInterceptList) {
            if (uriInterceptStrategy.verify(uri)) {
                return true;
            }
        }
        return false;
    }
}
